package com.ddy.test.string;

import com.google.common.collect.Lists;

import java.io.File;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;

/**
 * Created by ddy on 2020/6/17 9:51 AM
 */

public class StringTools {
    static String  s = "allow 14.18.183.0/24;\n" +
            "allow 58.246.221.0/24;\n" +
            "allow 59.36.95.0/24;\n" +
            "allow 59.36.129.0/24;\n" +
            "allow 59.36.132.0/24;\n" +
            "allow 61.151.182.0/24;\n" +
            "allow 101.91.24.0/24;\n" +
            "allow 101.89.27.0/24;\n" +
            "allow 101.89.32.0/24;\n" +
            "allow 101.89.34.0/24;\n" +
            "allow 101.89.238.0/24;\n" +
            "allow 123.150.72.0/24;\n" +
            "allow 123.150.78.0/24;\n" +
            "allow 180.97.118.0/24;\n" +
            "allow 183.3.227.0/24;\n" +
            "allow 183.3.253.0/24;\n" +
            "\n" +
            "allow 27.155.114.0/24;\n" +
            "allow 27.155.115.0/24;\n" +
            "allow 36.152.59.0/24;\n" +
            "allow 58.217.245.0/24;\n" +
            "allow 58.250.143.0/24;\n" +
            "allow 58.251.121.0/24;\n" +
            "allow 58.60.10.0/24;\n" +
            "allow 59.36.120.0/24;\n" +
            "allow 61.129.6.0/24;\n" +
            "allow 61.151.163.0/24;\n" +
            "allow 101.227.163.0/24;\n" +
            "allow 116.128.128.0/24;\n" +
            "allow 119.188.19.0/24;\n" +
            "allow 120.221.168.0/24;\n" +
            "allow 121.51.142.0/24;\n" +
            "allow 121.51.18.0/24;\n" +
            "allow 122.97.143.0/24;\n" +
            "allow 123.151.144.0/24;\n" +
            "allow 123.151.76.0/24;\n" +
            "allow 125.39.46.0/24;\n" +
            "allow 140.207.120.0/24;\n" +
            "allow 140.249.67.0/24;\n" +
            "allow 180.163.22.0/24;\n" +
            "allow 183.3.254.0/24;\n" +
            "allow 218.68.91.0/24 ;\n" +
            "allow 220.194.106.0/24;\n" +
            "allow 223.166.151.0/24;\n" +
            "\n" +
            "allow 140.249.242.0/24;\n" +
            "allow 101.89.239.0/24;\n" +
            "allow 119.167.231.0/24;\n" +
            "allow 101.91.94.0/24;\n" +
            "allow 59.83.217.0/24;\n" +
            "allow 180.96.55.0/24;\n" +
            "allow 157.255.131.0/24;\n" +
            "allow 23.166.150.0/24;\n" +
            "allow 101.89.33.0/24;\n" +
            "allow 121.12.105.0/24;\n" +
            "allow 58.247.204.0/24;\n" +
            "allow 61.151.203.0/24;\n" +
            "allow 61.151.179.0/24;\n" +
            "allow 61.241.37.0/24;\n" +
            "allow 14.18.174.0/24;\n" +
            "allow 223.166.150.0/24;\n" +
            "allow 121.12.105.0/24;\n" +
            "allow 14.18.174.0/24;\n" +
            "allow 101.89.13.0/24;\n" +
            "allow 61.241.37.0/24;\n" +
            "allow 61.151.205.0/24;\n" +
            "allow 61.151.181.0/24;\n" +
            "allow 123.151.190.0/24;\n" +
            "allow 123.151.66.0/24;\n" +
            "allow 157.255.131.0/24;\n" +
            "allow 121.12.105.0/24;\n" +
            "allow 140.249.242.0/24;\n" +
            "allow 121.12.105.0/24;\n" +
            "allow 157.255.131.0/24;\n" +
            "allow 119.167.231.0/24;\n" +
            "allow 140.249.242.0/24;\n" +
            "allow 157.255.131.0/24;\n" +
            "allow 121.12.105.0/24;\n" +
            "allow 140.249.242.0/24;\n" +
            "allow 121.12.105.0/24;\n" +
            "\n" +
            "allow 10.2.96.0/24;\n" +
            "allow 10.244.0.0/16;\n" +
            "allow 172.16.8.0/24;\n" +
            "allow 1.202.147.143/32;\n" +
            "allow 119.90.123.40/32;";

    public static void findRepeatedString(){
        List<String> list = new ArrayList<>();
        for (String ip : s.split("\n")){
            if(list.contains(ip)){
                continue;
            }
            list.add(ip);
        }
    }

    public static void main(String[] args) {
        findRepeatedString();
    }

}
